package com.simple.accounting.frag_record;

import androidx.fragment.app.Fragment;
import com.simple.accounting.R;
import com.simple.accounting.db.DBManager;
import com.simple.accounting.db.TypeBean;
import java.util.List;
/**
 * A simple {@link Fragment} subclass.
 */
public class OutcomeFragment extends BaseRecordFragment {


    // 重写
    @Override
    public void loadDataToGV() {
        super.loadDataToGV();
        //获取数据库当中的数据源
        List<TypeBean> outcomeLists = DBManager.getTypeList(0);
        typeList.addAll(outcomeLists);
        adapter.notifyDataSetChanged();
        typeTv.setText("餐饮");
        typeIv.setImageResource(R.mipmap.canyin_red);
    }

    @Override
    public void saveAccountToDB() {
        accountBean.setKind(0);
        DBManager.insertItemToAccountTb(accountBean);
    }
}
